{extend name="public:base"}

{block name="right"}
{if condition="$Think.session.sid eq '1'"}
<a href="{:Url('admin/adminadd')}" class="btn btn-success">添加管理员</a>
{/if}
{/block}

{block name="main"}
<form role="form">
    <div class="row">
        <div class="col-sm-3 col-xs-12 ">
            <div class="form-group">
                <div class="input-group">
                    <span class="input-group-addon">开始时间:</span>
                    <input type="date" name="start" class="form-control" value="{:input('start')}">
                </div>
            </div>
        </div>
        <div class="col-sm-3 col-xs-12 ">
            <div class="form-group">
                <div class="input-group">
                    <span class="input-group-addon">结束时间:</span>
                    <input type="date" name="end" class="form-control" value="{:input('end')}">
                </div>
            </div>
        </div>
        <div class="col-sm-3 col-xs-12 ">
            <div class="form-group">
                <div class="input-group">
                    <div class="btn-group">
                        <button type="submit" class="btn btn-success" title="立即搜索"><i class="fa fa-fw fa-search"></i></button>
                        {if condition="(input('get.start') gt '') OR (input('get.end') gt '')"}
                        <a href="{:Url('admin/adminlist')}" class="btn btn-default" title="查看全部"><i class="fa fa-close"></i></a>
                        {/if}
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
<table class="table table-bordered">
    <tbody>
    <tr>
      <th>ID</th>
      <th>管理员名称</th>
      <th>账号</th>
      <th>角色</th>
      <th>添加时间</th>
      <th>操作</th>
    </tr>
    {foreach $list as $v}
    <tr>
      <td>{$v['id']}</td>
      <td>{$v['name']}</td>
      <td>{$v['username']}</td>
      <td>{:find_value('admin_list',array('id'=>$v['groupid']),'name')}</td>
      <td>{$v['addtime']}</td>
      <th><button type="submit" class="btn btn-sm btn-default" onclick="savepwd();">修改密码</button></th>
    </tr>
    {/foreach}
  </tbody>
</table>
<script type="text/javascript">
    function savepwd(){
        $('#myModal').modal('show')
    }
</script>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">修改密码</h4>
      </div>
      <div class="modal-body">
        <div class="form-group">
          <label>新密码</label>
          <input type="text" class="form-control" placeholder="请输入新密码">
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-success pull-right">立即修改</button>
      </div>
    </div>
  </div>
</div>
{/block}
{block name="foot"}{$page}{/block}